import request from '@/utils/request'
// 获取用户基本信息
export const userProfileService = () => {
  return request.get('/my/userinfo')
}

// 更新用户基本信息
export const userUpdateService = (userInfo) => {
  return request.put('/my/userinfo', {
    id: userInfo.id,
    nickname: userInfo.nickname,
    email: userInfo.email,
    username: userInfo.username,
    user_pic: userInfo.user_pic
  })
}

// 更新用户头像
export const userUpdateAvatorService = (avator) => {
  return request.patch('/my/update/avatar', {
    avatar: avator
  })
}

// 更新用户密码
export const userUpdatePasswordService = (passwordForm) => {
  return request.patch('/my/updatepwd', {
    ...passwordForm
  })
}
